﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>current</Title>
      <Author>singba</Author>
      <Description>
      </Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>crt</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal default="true" Editable="false">
            <ID>ownerClass</ID>
            <ToolTip>Owner Class</ToolTip>
            <Function>ClassName()</Function> 
        </Literal>
        <Literal Editable="true">
          <ID>fileName</ID>
          <ToolTip>文件名</ToolTip>
          <Default>config.xml</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="csharp"><![CDATA[#region 属性 Current 
        private static $ownerClass$ _Current = null;
        private static object _LoadLock = new object();
        public static $ownerClass$ Current
        {
            get
            {
                if (_Current == null)
                {
                    lock (_LoadLock)
                    {
                        if (_Current == null)
                        {
                            _Current =  CreateOrLoad<$ownerClass$>("$fileName$");
                        }
                    }
                }
                return _Current;
            }
        }
        #endregion
	    $end$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>